functions in javascript are lexically rather than dynamically scoped . this means that they run in the scope in which they are defined, not the scope from which they are executed 函数是常量作用范围,而不是动态作用范围。这个意思就是说函数运行在它定义好的域中,而不是在执行执行它的域。
dynamically scoped meaning:[Computer] < language > In a dynamically scoped language, e.g. most versions of Lisp , an identifier can be referred to, not only in the block where it is declared, but also in any function...